﻿using System;
using System.Collections.Generic;
using System.Web;
using PayRoller.Code;
using System.Web.SessionState;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using HySoft.Cash.Business;
using HySoft.Cash.Structure;
using System.Configuration;
using System.Web.Profile;
using System.Web.UI;
namespace PayRoller.Manage.OrgInfo
{
    public class InvoicesOperate : Page, IRequiresSessionState
    {
        // Fields
        protected HtmlForm form1;

        // Methods
        protected void Page_Load(object sender, EventArgs e)
        {
            if (base.Request["OrgSid"] != null)
            {
                string str = base.Request["OrgSid"].ToString();
                string str2 = base.Request["Sid"].ToString();
                string str3 = base.Request["act"].ToString();
                TinvoicelistBN tbn = new TinvoicelistBN(this.Page);
                TinvoicelistDT detail = tbn.Get(Convert.ToInt32(str2));
                detail.Sid = Convert.ToInt32(str2);
                detail.IsValid = (InvoiceStatuses)Convert.ToInt32(str3);
                tbn.Edit(detail);
                tbn.Dispose();
                tbn = null;
                base.ClientScript.RegisterStartupScript(base.GetType(), "", "<script>alert('Success!');window.location='InvoicesList.aspx?OrgSid=" + str + "';</script>");
            }
        }

        // Properties
        protected HttpApplication ApplicationInstance
        {
            get
            {
                return this.Context.ApplicationInstance;
            }
        }

        protected DefaultProfile Profile
        {
            get
            {
                return (DefaultProfile)this.Context.Profile;
            }
        }
    }

}
